package com.love.cloud.admin.notify.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.love.cloud.admin.api.vo.UserVO;
import com.love.cloud.common.mybatis.entity.SimpleBaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author hongdongqu
 */
@Data
@Entity
@Table(name = "notify_article")
@TableName("notify_article")
@EqualsAndHashCode(callSuper = false)
@org.hibernate.annotations.Table(appliesTo = "notify_article",comment="通知公告文章表")
public class NotifyArticle extends SimpleBaseEntity {

    @ApiModelProperty(value = "创建用户id")
    @Column(columnDefinition = "bigint(20) COMMENT '创建用户id'")
    private Long userId;

    @ApiModelProperty(value = "文章标题")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '文章标题'")
    private String title;

    @ApiModelProperty(value = "文章类型：0文章，1是说说，2首页展示")
    @Column(columnDefinition = "int COMMENT '文章类型：0文章，1是说说，2首页展示'")
    private Integer type;

    @ApiModelProperty(value = "简单说明")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '文章类型：0文章，1是说说，2首页展示'")
    private String sampleContent;

    @ApiModelProperty(value = "历史的文章内容（只记录上一个版本的修改）")
    @Column(columnDefinition = "longtext COMMENT '历史的文章内容（只记录上一个版本的修改）'")
    private String historyContent;

    @ApiModelProperty(value = "文章内容")
    @Column(columnDefinition = "longtext COMMENT '文章内容'")
    private String content;

    @ApiModelProperty(value = "标签")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '标签'")
    private String label;

    @ApiModelProperty(value = "评论数量")
    @Column(columnDefinition = "int COMMENT '评论数量'")
    private Integer commentNum;

    @ApiModelProperty(value = "点赞数")
    @Column(columnDefinition = "int COMMENT '点赞数'")
    private Integer praiseNum;

    @ApiModelProperty(value = "观看数量")
    @Column(columnDefinition = "int COMMENT '观看数量'")
    private Integer lookNum;

    @ApiModelProperty(value = "备注")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '备注'")
    private String remarks;

    @ApiModelProperty(value = "状态")
    @Column(columnDefinition = "VARCHAR(10) COMMENT '状态'")
    private String status;

    @ApiModelProperty(value = "是否为私有,0为否，1为是")
    @Column(columnDefinition = "tinyint(1) COMMENT '是否为私有,0为否，1为是'")
    private Boolean isPrivate;

    /**
     * 文章的图片
     */
    @TableField(exist = false)
    @Transient
    private List<NotifyPicture> pictureList;

    /**
     *当前用户是否点赞
     */
    @TableField(exist = false)
    @Transient
    private  Boolean isPraise;


    /**
     * 用户信息
     */
    @TableField(exist = false)
    @Transient
    private UserVO userVO;
}
